package com.atguigu.threadtest;

/**
 * ClassName: NewThread
 * Package: com.atguigu
 * Description:
 *
 * @author: fu-wang
 * @create: 2024/10/28 17:09
 * version: 1.0
 *
 * 线程创建方式
 * 1. 继承Thread类，重写run方法
 * 2. 实现Runnable接口
 */
public class NewThread extends Thread{

    @Override
    public void run() {
        System.out.println("继承Thread类，重写run方法，创建线程...");
    }
}

class NewThread1 implements Runnable{

    @Override
    public void run() {
        System.out.println("实现Runnable接口，创建线程...");
    }
}


